xenstore: handle do_mkdir and do_rm failure
authorNorbert Manthey <nmanthey@amazon.de>
Fri, 26 Feb 2021 14:41:41 +0000 (15:41 +0100)
committerJulien Grall <jgrall@amazon.com>
Wed, 3 Mar 2021 18:17:14 +0000 (18:17 +0000)
commite0ca7b883a27919b968dc2c9d2fe2d0096342071
tree53ee71b94bd4ac9831dab8ff8acfe88b455d4a47
parent4a27a6786573067e69566afd2534edb2814de014
xenstore: handle do_mkdir and do_rm failure

In the out of memory case, we might return a NULL pointer when
canonicalizing node names. This NULL pointer is not checked when
creating a directory, or when removing a node. This change handles
the NULL pointer for these two cases.

This bug was discovered and resolved using Coverity Static Analysis
Security Testing (SAST) by Synopsys, Inc.

Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
Reviewed-by: Thomas Friebel <friebelt@amazon.de>
Reviewed-by: Julien Grall <jgrall@amazon.co.uk>
Reviewed-by: Juergen Gross <jgross@suse.com>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
tools/xenstore/xenstored_core.c